<template>
	<navbar title="关联订单" :isBack="true"></navbar>

	<view class="" v-if="Info.data.length > 0" v-for="item in Info.data"
		style="width: 100%;height: 100vh;background-color: #F9F9F9;padding: 30rpx;">
		<view class=""
			style="margin-bottom:20rpx;padding: 25rpx;background-color: white;border-radius: 10rpx;width: 100%;">
			<view class=""
				style="display: flex;justify-content: space-between;align-items: center;padding-bottom: 20rpx;border-bottom: 1rpx solid #F9F9F9;">
				<view class="" style="display: flex;align-items: center;">
					<image src="../../static/order/time.png" style="width: 28rpx;height: 28rpx;" mode="aspectFill">
					</image>
					<span style="margin-left: 10rpx;color: #535353;font-size: 24rpx;">{{item.create_time}}</span>
				</view>
				<view class="" style="font-size: 24rpx;">
					归属：{{item.name}}
				</view>
			</view>
			<view class="" style="margin-top: 20rpx;display: flex;">
				<view class="">
					<image :src="item.goods_cover" style="width: 92rpx;height: 92rpx;border-radius: 10rpx;" mode="">
					</image>
				</view>
				<view class="" style="margin-left: 20rpx;width: 100%">
					<view class="">
						{{item.goods_name}}
					</view>
					<view class=""
						style="margin-top: 24rpx;display: flex;justify-content: space-between;align-items: center;">
						<view class="" style="color: #9A9A9A;font-size: 26rpx;">
							{{item.mobile}}
						</view>
						<view class="" style="font-weight: bold;">
							￥{{item.total_price}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	<view class="" v-if="Info.data.length <= 0">
		<nodata></nodata>
	</view>
</template>

<script setup>
	import nodata from '@/components/nodata.vue'
	import {
		onLoad,
		onShareAppMessage,
		onShareTimeline,
		onReachBottom
	} from '@dcloudio/uni-app'
	import {
		orderTgList
	} from '@/service/api/index'
	import {
		reactive,
		ref
	} from 'vue'
	import tools from '@/utils/tools'
	const page = ref(1)
	const Info = ref({
		data: []
	})
	onLoad(() => {
		getData()
	})
	onReachBottom(() => {
		if (Info.value.current_page < Info.value.last_page) {
			page.value += 1;
			getData()
		}
	})
	const getData = async () => {
		const res = await orderTgList({
			page: page.value
		})
		Info.value = res.msg
	}
</script>

<style>
</style>